//调用接口配置文件
import { request,verifyCommissionToken } from 'config/request'
import config from '../../../config/config'
// 定义接口


//编辑时查询数据
export async function queryInfo (params) {
  return request({
    url: `${config.mideaCommission}commission/wxyxCommissionH/queryById`,
    method: 'GET',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}
//编辑时查询明细数据
export async function queryWxyxCommissionBByMainId (params) {
  return request({
    url: `${config.mideaCommission}commission/wxyxCommissionH/queryWxyxCommissionBByMainId`,
    method: 'GET',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}
//录入保存
export async function save (params) {
    return request({
      url: `${config.mideaCommission}commission/wxyxCommissionH/add`,
      method: 'POST',
      data: params,
      headers: {
        'Content-type': 'application/json',
      }
    })
  }
//录入编辑
export async function edit (params) {
  return request({
    url: `${config.mideaCommission}commission/wxyxCommissionH/edit`,
    method: 'PUT',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}

//佣金明细作废
export async function ondelete (params) {
  return request({
    url: `${config.mideaCommission}commission/wxyxCommissionH/invalid`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}

// 生成佣金明细
export async function loadData(params) {
  return request({
      url: `${config.mideaCommission}commission/wxyxCommissionH/loadData`,
      method: 'GET',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 获取项目列表
export async function selectProject(params) {
  return request({
      url: `${config.mideaCommission}commission/wxyxCommissionH/selectProject`,
      method: 'GET',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 获取费控核算主体
export async function selectSubject(params) {
  return request({
      url: `${config.mideaCommission}commission/wxyxCommissionH/selectSubject`,
      method: 'GET',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 线下结佣
export async function offlineCommission(params) {
  return request({
      url: `${config.mideaCommission}commission/wxyxCommissionH/offlineCommission`,
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

export async function verifyCommissionTokenFun(){
  return verifyCommissionToken();
}
//成交房源付款方式
export async function paymentMethod (params) {
    return request({
      url: `${config.mideaCommission}commission/wxyxCommissionH/paymentMethod`,
      method: 'POST',
      data: params,
      headers: {
        'Content-type': 'application/json',
      }
    })
  }
  









